﻿using System;
using System.Data;
using System.Drawing;
using System.Web.UI.WebControls;
using HiauPdm.Bll;
using HiauPdm.Web;

namespace HiauPdm.Web
{
    public partial class WzKcCxTz : PageBase
    {
        protected override bool IsAccess()
        {
            return IsAccess("Jsc/WzKcCx.aspx");
        }

        /// <summary>
        /// 加载
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack) { return; }
            BindData(Request.QueryString["sWzBh"]);
        }

        /// <summary>
        /// 绑定刷新数据
        /// </summary>
        private void BindData(string sWzBh)
        {
            // 查询数据
            LblTitle.Text = sWzBh;
            // 查询数据
            DataSet ds = BCkGl.GetWzKcTzByCx(sWzBh);
            if (ds == null || ds.Tables[0].Rows.Count <= 0)
            {
                PanelList1.Visible = true;
                PanelList2.Visible = false;
                return;
            }
            PanelList1.Visible = false;
            PanelList2.Visible = true;
            // 绑定表格
            GridData.DataSource = ds;
            GridData.DataBind();
            GridData.SelectedIndex = -1;
        }
    }
}